package com.geek.water.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author yangwenqi
 * @decs 账单明细表
 * @date 2025/8/5
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("bill_detail")
@ApiModel(description = "账单明细表")
public class BillDetail implements Serializable {
    @ApiModelProperty("主键，自增明细ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("关联账单ID")
    @TableField("bill_id")
    private Long billId;

    @ApiModelProperty("关联设备ID")
    @TableField("device_id")
    private Long deviceId;

    @ApiModelProperty("关联区域ID")
    @TableField("area_id")
    private Long areaId;

    @ApiModelProperty("关联站点ID")
    @TableField("site_id")
    private Long siteId;

    @ApiModelProperty("用水量(吨)")
    @TableField("usage_amount")
    private BigDecimal usageAmount;

    @ApiModelProperty("小计金额")
    @TableField("subtotal")
    private BigDecimal subtotal;

    @ApiModelProperty("计费周期(格式: yyyy-MM)")
    @TableField("billing_period")
    private String billingPeriod;

    @ApiModelProperty("当前读数(吨)")
    @TableField("current_reading")
    private BigDecimal currentReading;

    @ApiModelProperty("上次读数(吨)")
    @TableField("last_reading")
    private BigDecimal lastReading;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("更新时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}